package servlets;
 
import java.io.IOException;
 
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
 
@WebServlet(name = "Deconnexion", urlPatterns = "/deconnexion")
public class Deconnexion extends HttpServlet {
 
    @Override
    public void doGet( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException {
        
        /* Récupération et destruction de la session en cours */
        HttpSession session = request.getSession();
        session.invalidate();
 
        /* Redirection vers la page d'accueil */
        response.sendRedirect( "index.jsp" );
       }
}